<?php
/*************************************************

验证码主模型 - the 
Author: Reload <17-5-26>

*************************************************/
namespace Home\Model;
use Think\Model\RelationModel;
class VerificationModel extends RelationModel {


    //查询单数据
    public function get_one($map,$order="add_time desc"){
        $data = $this->where($map)->order($order)->find();
        return $data;
    }

    //更新
    public function edit($map,$data){
        $r = $this->where($map)->save($data);
        return $r;
    }

    //统计
    public function count($map){
        $count = M('Verification')->where($map)->count();
        return $count;
    }


    //添加
    public function add($data){
         $data =M('Verification')->data($data)->add();
        return $data;
    }
    

}